package com.thb.pay.api.payment;


import com.thb.pay.api.payment.fallback.PayInterfaceServiceApiFallbackFactory;
import com.thb.pay.api.payment.vo.req.PayInterfacePageReq;
import com.thb.pay.api.payment.vo.req.PayInterfaceReq;
import com.thb.pay.api.payment.vo.resp.PayInterfaceVo;
import com.thb.pay.core.utils.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <p>
 * 支付-接口表 前端控制器
 * </p>
 *
 * @author lucky
 * @since 2019-10-15
 */
@FeignClient(value = "pay-service", fallbackFactory = PayInterfaceServiceApiFallbackFactory.class)
@RequestMapping("/payInterfaceApi")
public interface PayInterfaceServiceApi {

    @RequestMapping(value = "/findPage", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    PageResult<PayInterfaceVo> findPage(@RequestBody PayInterfacePageReq pageReq);

    @RequestMapping(value = "/add", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void add(@RequestBody PayInterfaceReq payInterfaceReq);

    @RequestMapping(value = "/update", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void update(@RequestBody PayInterfaceReq payInterfaceReq);

    @RequestMapping(value = "/getByCode", method = RequestMethod.GET)
    PayInterfaceVo getByCode(@RequestParam("code") String code);

    @RequestMapping(value = "/getById", method = RequestMethod.GET)
    PayInterfaceVo getById(@RequestParam("id") Long id);

}
